package Test;
import java.util.Random;
import algorithm.*;


public class TestRandom {
public static void main(String arg[])
{
	int tcNum=10;
	MParameter tmp[] = new MParameter[4];
	tmp[0] = new MParameter(ParaType.INTEGER, "num", 10, -10);
	tmp[1] = new MParameter(ParaType.DOUBLE, "count", 10.0, 0.0);
	tmp[2] = new MParameter(ParaType.STRING, "path", 10, 0);
	tmp[3] = new MParameter(ParaType.CHAR, "char", 0, 0);
	AlgorithmStrategy rs=new RandomStrategy("filepath","temp",tcNum,tmp);
	Object[][] obj=new Object[tmp.length][tcNum];
    obj=rs.getValues();
	for(int i=0;i<tcNum;i++)
	{
		for(int j=0;j<tmp.length;j++)
			System.out.print(tmp[j].getName()+":"+obj[j][i].toString()+";  ");
		System.out.print("\n");
	}

}

public static String getRandomString(int length) {   
	String base = " 	!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_'abcdefghijklmnopqrstuvwxyz{|}~";   
	Random random = new Random();   
	StringBuffer sb = new StringBuffer();   
	for (int i = 0; i < length; i++) {   
	      int number = random.nextInt(base.length());   
	      sb.append(base.charAt(number));   
    }   
       return sb.toString();    
	}   

}